Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🌱WIL
🚀주간 목표 문제 수: 5개
백준 #2110. 공유기 설치: 이진탐색/ 골드4
정리한 링크: (바로가기)
🚩플로우 (선택)
N개 집 위치 오름차순 정렬
“최소 거리 dist”의 탐색 범위 초기화 # 이진 탐색
start = 1
end = arr[-1] - arr[0]
mid = (start+ene)//2
최대 인접거리 dist의 최대값을 찾기 위한 이진 탐색 수행 ( start ≤ end 까지 반복)
(1) “최소거리 dist = mid 이상”으로 최대한 설치 가능한 공유기 개수 계산하기
prev간의 거리가 mid 이상이면→ 설치 (
cnt+=1)+ prev = arr[i] 이전 설치지점 업데이트(2) 최소 인접거리 dist 의 이분 탐색
최소 인접거리 후보군 등록
(탐색 시작 지점 start → mid +1 이동 )
그렇지 않을 경우 , 탐색 범위 lower bound 로 이동
(탐색 종료 지점 end → mid-1 이동)
🚩제출한 코드
💡TIL
이진탐색과 달리, <조건>을 충족하는 중간값을 찾아도, 중단하지 않고 모든 범위를 탐색한다.
백준 #1654. 랜선 자르기: 이진탐색 / 실버2
정리한 링크: (바로가기)
🚩플로우 (선택)
🚩제출한 코드
프로그래머스 #169199. 리코쳇 로봇: 그래프 / lv2
정리한 링크: (바로가기)
🚩플로우 (선택)
필드 board을 2차원 배열 field 로 변환
다음 이동 지점 함수 정의
다음 이동할 지점 = 상/하/좌/우 중 한 방향으로 장애물 or 가장자리에 도달할때 까지 이동
(일반적인 상하좌우 1칸씩 이동이 아님)
BFS로 탐색
출력 형식
🚩제출한 코드
💡TIL
프로그래머스 #87946. 피로도: 완전탐색 / lv2
정리한 링크: (바로가기)
🚩플로우 (선택)
🚩제출한 코드
💡TIL
global: 전역 변수-
nonlocal: 본인 스코프 반대 방향으로 가장 가까운 변수를 찾는다(전역변수은 찾지 않음 )프로그래머스 #70129. 이진변환 반복하기: 문자열 / lv2
정리한 링크: (바로가기)
🚩제출한 코드